package com.lihui.输出连续最长数字串;

import java.util.Scanner;

/**
 * 功能描述
 *
 * @author wileda
 * @date 2022/11/22  20:49
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            String str = sc.nextLine();
            System.out.println(numStr1(str));
        }
    }

    public static String numStr(String str) {
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < str.length(); i++) {
            if (str.charAt(i) >= '0' && str.charAt(i) <= '9') {
                sb.append(str.charAt(i));
            } else {
                sb.append(" ");
            }
        }
        String str1 = sb.toString();

        String[] arr = str1.split(" ");
        int maxLen = arr[0].length();
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].length() > maxLen) {
                maxLen = arr[i].length();
            }
        }
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].length() == maxLen) {
                return arr[i];
            }
        }
        return null;
    }

    public static String numStr1(String str) {
        String cur = "";
        String ret = "";
        int i = 0;
        for (; i < str.length(); i++) {
            char ch = str.charAt(i);
            if (ch >= '0' && ch <= '9') {
                cur = cur + ch + "";
            } else {
                if (cur.length() > ret.length()) {
                    ret = cur;
                } else {
                    cur = "";
                }
            }
        }
        return ret;
    }


}
